<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="utf-8">
  <!-- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> -->
  <meta name="viewport"
    content="width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <meta name="theme-color" content="#000000">
  <!--
      manifest.json provides metadata used when your web app is added to the
      homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
    -->
  <!-- Specifying a Webpage Icon for Web Clip for Safari -->
  <link rel="apple-touch-icon" href="https://s2.ax1x.com/2019/10/08/uf0ySe.png">
  <!-- <link rel="apple-touch-icon" href="/256X256.ico"> -->
  <!-- Specifying a Launch Screen Image for Safari -->
  <link rel="apple-touch-startup-image" href="https://s2.ax1x.com/2019/10/08/uf0ySe.png">
  <!-- <link rel="apple-touch-startup-image" href="/256X256.ico"> -->
  <meta name="viewport"
    content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />

  <meta name="screen-orientation" content="portrait">

  <meta name="x5-orientation" content="portrait">

  <!-- Hiding Safari User Interface Components -->
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name=“apple-mobile-web-app-title” content="演示Pro">
  <meta name="referrer" content="origin">
  <!-- Changing the Status Bar Appearance -->
  <!-- <meta name="apple-mobile-web-app-status-bar-style" content="black"> -->

  <link rel="manifest" href="/manifest.json">
  <link rel="shortcut icon" href="/256X256.ico">
  <script>
    function getAllUrlParams(url) {
      // 用JS拿到URL，如果函数接收了URL，那就用函数的参数。如果没传参，就使用当前页面的URL
      var queryString = url ? url.split('?')[1] : window.location.search.slice(1);
      // 用来存储我们所有的参数
      let obj = {};
      // 如果没有传参，返回一个空对象
      if (!queryString) {
        return obj;
      }
      // stuff after # is not part of query string, so get rid of it
      queryString = queryString.split('#')[0];
      // 将参数分成数组
      var arr = queryString.split('&');
      for (var i = 0; i < arr.length; i++) {
        // 分离成key:value的形式
        var a = arr[i].split('=');
        // 将undefined标记为true
        var paramName = a[0];
        var paramValue = typeof (a[1]) === 'undefined' ? true : a[1];
        // 如果调用对象时要求大小写区分，可删除这两行代码
        paramName = paramName.toLowerCase();
        if (typeof paramValue === 'string') paramValue = paramValue;
        // 如果paramName以方括号结束, e.g. colors[] or colors[2]
        if (paramName.match(/\[(\d+)?\]$/)) {
          // 如果paramName不存在，则创建key
          const key = paramName.replace(/\[(\d+)?\]/, '');
          if (!obj[key]) {
            obj[key] = []
          };
          // 如果是索引数组 e.g. colors[2]
          if (paramName.match(/\[\d+\]$/)) {
            const tarArray = /\[(\d+)\]/.exec(paramName);
            // 获取索引值并在对应的位置添加值
            if (tarArray) {
              let index = tarArray[1];
              obj[key][index] = paramValue;
            }
          } else {
            // 如果是其它的类型，也放到数组中
            obj[key].push(paramValue);
          }
        } else {
          // 处理字符串类型
          if (!obj[paramName]) {
            // 如果如果paramName不存在，则创建对象的属性
            obj[paramName] = paramValue;
          } else if (obj[paramName] && typeof obj[paramName] === 'string') {
            // 如果属性存在，并且是个字符串，那么就转换为数组
            obj[paramName] = [obj[paramName]];
            obj[paramName].push(paramValue);
          } else {
            // 如果是其它的类型，还是往数组里丢
            obj[paramName].push(paramValue);
          }
        }
      }
      return obj;
    }
    var ua = navigator.userAgent.toLowerCase();
    var isWeixin = ua.indexOf('micromessenger') != -1;
    window.sessionKey = 'code-s';
    var sessionKey = window.sessionKey;
    var codeStory = window.sessionStorage.getItem(sessionKey);
    if (isWeixin && window.location.href && window.location.href.indexOf('?code=') < 0 && !codeStory) {
      window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=
		wx59c1b6aa9c2ba1b8&redirect_uri=${encodeURIComponent(
        'http://m.Tigase.top'
      )}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
    } else
      if (isWeixin && window.location.href && window.location.href.indexOf('?code=') > -1) {
        const data = getAllUrlParams(window.location.href) || {}
        window.sessionStorage.setItem(sessionKey, data.code);
        const editWithoutUrl = window.location.href.split('?code=')[0]
        window.location.href = editWithoutUrl;
      }
    // else if(window.location.href && window.location.href.indexOf('?code=') > -1 && window.location.href.indexOf('&') > -1){
    //   const editWithoutUrl = window.location.href.split('&')[0]
    //   // console.log('editWithoutUrl',editWithoutUrl);
    //   window.location.href = editWithoutUrl;
    // }
  </script>

  <script src="./esdk-obs-browserjs-3.19.5.min.js"></script>
  <script>
    window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", hengshuping, false);
    // document.addEventListener('touchmove',
    //   function (e) {
    //     e.preventDefault();
    //   }, { passive: false });

    function hengshuping() {
      if (window.orientation == 90 || window.orientation == -90) {
        //横屏
        // console.log('横屏！～～～～');

      } else {
        //竖屏
        // console.log('竖屏！·············');
      }
    }
    var self = this;
    window.onload = function () {
      document.addEventListener('touchstart', function (event) {
        self.moveY = event.targetTouches[0].pageY;
        if (event.touches.length > 1) {
          event.preventDefault();
        }
      })
      var lastTouchEnd = 0;
      document.addEventListener('touchend', function (event) {
        var now = (new Date()).getTime();
        if (now - lastTouchEnd <= 300) {
          event.preventDefault();
        }
        lastTouchEnd = now;
      }, false)

      window.standalone = window.navigator.standalone;//是否是从桌面启动
    }
    document.addEventListener('gesturestart', function (event) {
      event.preventDefault();
    });
    history.pushState(null, null, document.URL);
    window.addEventListener('popstate', function () {
      history.pushState(null, null, document.URL);
    });
    document.addEventListener('touchmove', function (e) {
      e.preventDefault();
      let moveWidth = self.moveY - e.targetTouches[0].pageY;
      if (moveWidth !== 0) {
        document.body.scrollTop += moveWidth;
      }
    })
    document.addEventListener('touchmove', function (e) {
      e.preventDefault();
    })
  </script>
  <script>
    // var electron = window['electron'];
    // var ipcRenderer = electron ? electron.ipcRenderer : null;

    // ipcRenderer && ipcRenderer.on('message', (event, { message, data }) => {

    //   switch (message) {
    //     case 'isUpdateNow':
    //       if (window.confirm('现在更新？')) {
    //         ipcRenderer.send('updateNow');
    //       }
    //       break;
    //     default:
    //       console.log(message,data)
    //       break;
    //   }
    // });




  </script>

  <!--
      Notice the use of  in the tags above.
      It will be replaced with the URL of the `public` folder during the build.
      Only files inside the `public` folder can be referenced from the HTML.

      Unlike "/favicon.ico" or "favicon.ico", "/favicon.ico" will
      work correctly both with client-side routing and a non-root public URL.
      Learn how to configure a non-root public URL by running `npm run build`.
    -->
  <title>演示</title>
</head>

<body style="border-radius: 4px;border: 0px solid gray;overflow: hidden; box-shadow: 0 0 10px rgba(0, 0, 0, 1); ">
  <noscript>
    You need to enable JavaScript to run this app.
  </noscript>
  <div id="root" style="width:100%;height:100%;border-radius: 4px;border: 0px solid gray;overflow: hidden; "></div>
  <!--
      This HTML file is a template.
      If you open it directly in the browser, you will see an empty page.

      You can add webfonts, meta tags, or analytics to this file.
      The build step will place the bundled scripts into the <body> tag.

      To begin the development, run `npm start` or `yarn start`.
      To create a production bundle, use `npm run build` or `yarn build`.
    -->

</body>

</html>